package aop.log.advice;

import java.util.logging.Logger;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class LogAdvice implements MethodInterceptor{

		public Object invoke(MethodInvocation invocation) throws Throwable{
			login();
			
			
			Object ob = invocation.proceed();
			
			logout();
			
			return ob;
		}
	
	private void logging(String msg) {
		Logger logger=Logger.getLogger(LogAdvice.class.getName());
		logger.info(msg);
	}
	
	private void login() {
		logging("用户登录操作执行之前的日志信息");
		
	}
	private void logout() {
		logging("用户登录操作执行之后的日志信息");
		
	}
}
